/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package net.easoftware.code.beans;

import javax.faces.context.FacesContext;

/**
 *
 * @author eder.herrera
 */
public class BeanHelper {

    private static Object MbSummary;
    private static Object ReporteDao;

    public static Object manualInject(String beanELName) {
        FacesContext fc = FacesContext.getCurrentInstance();
        return fc.getApplication().getELResolver().
                getValue(fc.getELContext(), null, beanELName);
    }

    public static <T> T findBean(String beanName) {
        FacesContext context = FacesContext.getCurrentInstance();
        return (T) context.getApplication().evaluateExpressionGet(context, "#{" + beanName + "}", Object.class);
    }
}
